package com.woniu.command.warehouseCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.WarehouseCommandHandler;
import com.woniu.utils.ApplicationContextHolder;

public class DeleteWarehouseCommand implements Command<Long,Integer> {

    private WarehouseCommandHandler handler;
    public DeleteWarehouseCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(WarehouseCommandHandler.class);
    }
    @Override
    public Integer  execute(Long id) {
        return handler.deleteWarehouseById(id);
    }
}
